package com.yyhh.helpcall.activity;

import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import com.yyhh.helpcall.R;

public class ProgressDialogFragment extends DialogFragment {

    private String messageText = "加载中...";

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        setCancelable(false);
        Window window = getDialog().getWindow();
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        View rootView = inflater.inflate(R.layout.progress_dialog, container, false);
        TextView tv = rootView.findViewById(R.id.text);
        tv.setText(messageText);
        return rootView;
    }

    public void setMessageText(String text){
        messageText = text;
    }

}
